package PTA;
import java.util.*;

public class xt10_7_3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        while(sc.hasNextLine()){
            String str = sc.nextLine();
            int sum = 0;

            for (int i = 0; i < str.length(); i++) {
                    char ch = str.charAt(i);
                    if(ch >= '1' && ch <= '9'){
                        sum += (ch - '0');
                    }
            }
            System.out.println(sum);
        }

    }
}
